package com.boyu.common;

import com.boyu.common.model.Menu;
import com.boyu.common.model.ProductAttr;
import com.boyu.common.model.SystemAttr;

import java.util.List;

/**
 * Created by Administrator on 2016/8/29.
 */
public class AttrUtils {
    public static ProductAttr getProductAttr(int id) {
        ProductAttr productAttr = ProductAttr.dao.findById(id);
        return productAttr;
    }
    public static List<ProductAttr> getProductAttrList(int optionId) {
        List<ProductAttr> productAttrList = ProductAttr.dao.find("select * from t_product_attr where optionId=?", optionId);
        return productAttrList;
    }
    public static SystemAttr getSystemAttr(int id) {
        SystemAttr systemAttr = SystemAttr.dao.findById(id);
        return systemAttr;
    }
    public static List<SystemAttr> getSystemAttrList(int optionId) {
        List<SystemAttr> systemAttrList = SystemAttr.dao.find("select * from t_system_attr where optionId=?", optionId);
        return systemAttrList;
    }

    public static List<Menu> getMenuList() {
        List<Menu> menus = Menu.dao.find("select * from t_menu where isDel = 0 order by orderBy asc");
        return menus;
    }
}
